//
// Page Initialisation
//

Ext.namespace('RaidAssist.Index');

//
// Page Helper Functions
//

//
// Declare page application object
//

RaidAssist.Index.app = function(){

	var homeSitePanel = new Ext.ux.ManagedIframePanel({
		 id: 'homeSite'
		,disableMessaging: true
		,frameConfig : {
			autoCreate: { 
				id: 'homeSite' 
			}
		}
        ,loadMask: {
			 hideOnReady: false
			,msg: 'Loading Site...'
		}
        ,defaultSrc: 'http://thorinsshield.gamerdna.com'
		,bbar : [
			{
				 xtype: 'tbbutton'
				,text: 'Assist Menu'
				,menu: [
					{
						text: 'Settings'
					   ,handler: function() {
							Ext.Msg.alert('FIXME', 'Not implemented.');
						}
					},
					{
						 text: 'Refresh Home page'
						,handler: function() {
							homeSitePanel.setSrc();
						}
					}
				]
			}
		]
	});
	
	var viewport = new Ext.Viewport({
		 //layout: 'fit'
		//,
		items: [homeSitePanel]
	});

	return {
		init: function(){
			//homeSitePanel.setSrc();
		}
	};	

}();	

//
// Load the page
//
Ext.onReady(RaidAssist.Index.app.init,
            RaidAssist.Index.app);
